<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/pages/templates/TemplateResto.xhtml">


	<ui:define name="titre">Comme au resto</ui:define>

	<ui:define name="content">
		<h:head>
		<br/>
		</h:head>
		<h:body>
			<h:form>
 				<div>
					<br /> <span>Commandes du Restaurant   </span>

					<br /> <br />
				</div>

				<p:dataTable border="1" id="listeCmd" var="r" value="#{commandeRestoMB.listeCommandes}"   rowKey="#{r.id}" 
                selection="#{commandeRestoMB.selectedCmd}" selectionMode="single">
 					<p:column>
						<f:facet name="header">
							<f:verbatim>Id commande</f:verbatim>
						</f:facet>
						<h:outputText value="#{r.id}" />
					</p:column>
  					<p:column>
						<f:facet name="header">
							<f:verbatim>Client</f:verbatim>
						</f:facet>
						<h:outputText value="#{r.client.nom} #{r.client.prenom}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<f:verbatim>Etat commande</f:verbatim>
						</f:facet>
						<h:outputText value="#{r.etatCommande.libelle}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<f:verbatim>Total commande</f:verbatim>
						</f:facet>
						<h:outputText value="#{r.totalCommande}" />
					</p:column>
				</p:dataTable>
				<br />
				<div>
				<p:commandButton value="En Livraison" action="#{commandeRestoMB.cdeEnLivraison}" />
				<p:commandButton value="Commande Livrée" action="#{commandeRestoMB.cdeLivree}" />
				</div>
			</h:form>
		</h:body>
	</ui:define>
</ui:composition>
